<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="/common/taglibs.jsp"%>
<link rel="stylesheet" type="text/css" href="${ctx}/styles/pop.css" media="screen"/>
<div class="pop_login_logo">
	<center><img class="logo_img" alt="<fmt:message key='sys.name.sns' />" src="${ctx}/images/logo.gif" /></center>
</div>
<div class="pop_login_form">
	<center>
	<table>
		<tr class="tr35">
			<td class="tdright"><span>用户名:</span></td>
			<td class="tdleft"><input type="text" id="login_username" name="username" class="input"/></td>
		</tr>
		<tr class="tr35">
			<td class="tdright"><span>密码:</span></td>
			<td class="tdleft"><input type="text" id="login_password" name="password" class="input"/></td>
		</tr>
		<tr class="tr40">
			<td colspan="2" class="tdcenter"><input class="btn1"type="button" onclick="javascript:poplogin()" value="登陆"></td>
		</tr>
	</table>
	</center>
</div>
<script>
function poplogin(){
	var username = document.getElementById("login_username").value;
	var password = document.getElementById("login_password").value;
	$.ajax({
		type : "POST",
		url : ctx + "/h/login.do",
		data : "account=" + username + "&password="+password,
		dataType:"xml", 
		timeout:20000,
		success : function(data){
			if($(data).find('result').text().toUpperCase().indexOf("TRUE") >= 0){
				$("#a_go_login").colorbox.close();
				window.location.href = window.location.href;
			}else{
				var value = "";
				$(data).find('item').each(function(){
					position = $(this).find('position').text();
					value = $(this).find('value').text();
				});
				alert(value);
			}
		},
		error: function(){
		}
	});
}
</script>